<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>根据平均成绩来划分等级</title>
    </head>
    <body>
<script>
var Chinese = prompt('请输入语文成绩：');
var Mathmatics = prompt('请输入数学成绩：');
var English = prompt('请输入英语成绩：');
var Chemistry = prompt('请输入化学成绩：');
var H1story = prompt('请输入历史成绩：');

var result = ((parseFloat(Chinese)+parseFloat(Mathmatics)+parseFloat(English)
+parseFloat(Chemistry)+parseFloat(H1story))/5);

var level= Math.floor(result/10);


switch (level) {
    case 10 :
    alert('优秀');
        break;
    case 9 :
        alert('优秀');
        break;
        case 8 :
            alert('良好');
            break;
        case 7 :
            alert('一般');
            break;
        case 6 :
            alert('较差');
            break;
        default :
            alert('很差');
}
</script>
    </body>
</html>